import ProxyInterface from '../proxy-interface';
import { AccountEmailInscribe, AccountProfileModel } from '../model/account';

class AccountProfileProxy implements ProxyInterface<AccountProfileModel> {
  public accountProfileModel = new AccountProfileModel();

  constructor (responseData) {
    let data = responseData.data || responseData;
    Object.assign<AccountProfileModel, AccountProfileModel>(this.accountProfileModel, data)
  }

  getModel (): AccountProfileModel {
    return this.accountProfileModel;
  }
}

class AccountEmailInscribeProxy implements ProxyInterface<AccountEmailInscribe> {
  public emailInscribe = new AccountEmailInscribe()

  constructor (responseData) {
    let data = responseData.data || responseData
    Object.assign<AccountEmailInscribe, any>(this.emailInscribe, data)
  }

  getModel (): AccountEmailInscribe {
    return this.emailInscribe
  }
}

export {
  AccountProfileProxy,
  AccountEmailInscribeProxy
}
